<template>
    <Form
            :form-items="formItems"
            :init-data-url="$baseURL.house + '/house/estatelicence/' + $route.params.id"
            :handle-init-data="(data)=>{
            data.estateId__label = data.estateName
            return data
            }"
    ></Form>
</template>

<script>
    import Form from '../../../../common-util/src/components/page/Form.vue'
    export default {
        components:{
            Form
        },
        data(){
            return {
                formItems:[
                    {
                        field: {
                            name: 'code'
                        },
                        element:{
                            label: '编号',
                            required: true
                        }
                    },
                    {
                        field: {
                            name: 'name'
                        },
                        element:{
                            label: '名称',
                            required: true
                        }
                    },
                    {
                        field: {
                            name: 'estateId',
                            value: this.$route.query.estateId || null,
                            estateId__label: this.$route.query.estateName || null
                        },
                        element:{
                            label: '楼盘',
                            type: 'selectRemote',
                            selectRemote:{
                                url: this.$baseURL.house + '/house/estate/listPage',
                            },
                            required: true
                        }
                    },
                    {
                        field: {
                            name: 'permitTypeDictId'
                        },
                        element:{
                            label: '五证许可类型',
                            type: 'selectDict',
                            selectDict: {
                                groupCode: 'estate_licence_permit_type'
                            },
                            required: true

                        }
                    },
                    {
                        field: {
                            name: 'imageUrl'
                        },
                        element:{
                            label: '图片地址',
                            type: 'upload',
                            upload: {
                                type: 'uploadInput',
                                accept: 'image/*'
                            },
                            required: true
                        }
                    },
                    {
                        field: {
                            name: 'permitAt'
                        },
                        element:{
                            label: '发证日期',
                            type: 'date',
                            date: {
                                type: 'date',
                                valueFormat: 'timestamp'
                            },
                            required: true
                        }
                    },
                    {
                        field: {
                            name: 'seq'
                        },
                        element:{
                            label: '排序',
                            type: 'inputNumber',
                            required: true
                        }
                    },
                    {
                        field: {
                            name: 'remark'
                        },
                        element:{
                            label: '备注'
                        }
                    },
                    {
                        field: {
                            name: 'version'
                        }
                    },
                    {
                        element:{
                            type: 'button',
                            button:[
                                {
                                    action: 'submit',
                                    requestMethod:'put',
                                    url: this.$baseURL.house + '/house/estatelicence/' +this.$route.params.id,
                                    label: '保存'
                                },
                                {
                                    action: 'reset',
                                    label: '重置',
                                    type: 'default'
                                }
                            ]
                        }
                    }
                ]
            }
        },
        mounted(){
        },
        methods:{
        }
    }
</script>

<style scoped>

</style>